import {Viewer} from "cesium";
import {createEventRegister} from "yt-cesium";

const clearEventMap: WeakMap<Viewer, Set<Function>> = new WeakMap()


export const onClear = /*#__PURE__*/createEventRegister(clearEventMap);

export function handleClearEventByViewer(viewer: Viewer) {
  clearEventMap.get(viewer)?.forEach(fn => {
    fn()
  })
}
